package com.yckj.activechicken.business.common.mapper;

import com.yckj.activechicken.business.common.model.CustomSequence;
import com.yckj.activechicken.business.common.model.CustomSequenceExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CustomSequenceMapper {
    long countByExample(CustomSequenceExample example);

    int deleteByExample(CustomSequenceExample example);

    int deleteByPrimaryKey(Integer sequenceId);

    int insert(CustomSequence record);

    int insertSelective(CustomSequence record);

    List<CustomSequence> selectByExample(CustomSequenceExample example);

    CustomSequence selectByPrimaryKey(Integer sequenceId);

    int updateByExampleSelective(@Param("record") CustomSequence record, @Param("example") CustomSequenceExample example);

    int updateByExample(@Param("record") CustomSequence record, @Param("example") CustomSequenceExample example);

    int updateByPrimaryKeySelective(CustomSequence record);

    int updateByPrimaryKey(CustomSequence record);

    /**
     * 设置序列初始值
     * @param record
     * @return
     */
    String SetVal(CustomSequence record);

    /**
     * 查询当前序列值
     * @param sequenceName
     * @return
     */
    String selectCurrVal(String sequenceName);


    /**
     * 查询下一序列值
     * @param sequenceName
     * @return
     */
    String selectNextVal(String sequenceName);

    /**
     * 分页查询序列信息
     * @param customSequence
     * @return
     */
    List<CustomSequence> selectSequenceList(CustomSequence customSequence);
}